package com.zhike.controller;

import com.zhike.service.DwsAlarmBtWindowService;
import com.zhike.service.DwsAlarmWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/2
 * @Description:
 */
@RestController
@RequestMapping("alarm")
public class AlarmWeekController {
    @Autowired
    private DwsAlarmWindowService dwsAlarmWindowService;

    @Autowired
    private DwsAlarmBtWindowService dwsAlarmBtWindowService;
    /**
     * 获取当日每辆车的告警次数
     */
    @PostMapping("getAlarmCountWeek")
    public String getAlarmCountWeek(@RequestBody String filter){
        return dwsAlarmWindowService.getAlarmCountWeek(filter);
    }

    /**
     * 获取当日各车型的告警次数
     */
    @PostMapping("getAlarmTypeWeek")
    public String getAlarmTypeToday(@RequestBody String filter){
        return dwsAlarmBtWindowService.getAlarmTypeWeek(filter);
    }

    /**
     * 获取当日各品牌的告警次数
     */
    @PostMapping("getAlarmBrandWeek")
    public String getAlarmBrandWeek(@RequestBody String filter){
        return dwsAlarmBtWindowService.getAlarmBrandWeek(filter);
    }

}
